#include "stm32f10x.h"                  // Device header
#include "Delay.h"
#include "OLED.h"
#include "Uart.h"
#include "DMA_UART1.h"

int main(void)
{
	/*模块初始化*/
	OLED_Init();		//OLED初始化
	
    init_uart_with_dma();
    
    init_dma_for_uart1();
    
	/*OLED显示*/

	OLED_ShowString(1, 1, "sending:");	//1行3列显示字符串HelloWorld!
	OLED_ShowString(2, 1, "received:");
    uint8_t ch[] = "A\n";
	
	while (1)
	{
        // A = 65
        // Z = 90
		for(uint8_t i=0x41;i<0x5a;i++){
        
            //OLED_ShowChar(1,9,i);
            ch[0] = i;
            send(&i,1);
            Delay_ms(100);
        }
        
        if(is_receive_successful()){
            //OLED_ShowChar(2,10,rx_data[1]);
        }
	}
}
